<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use RongCloud\RongCloud;

class RongMsgHistory extends Command
{
    protected $signature = 'RongMsgHistory';

    private $rc_handle = NULL;

    protected $description = '周二更新dd返利数据';

    public function __construct()
    {
        parent::__construct();
        //单例
        if (is_null($this->rc_handle)) {
            $config = config('rong_cloud');
            $this->rc_handle = new RongCloud($config['appKey'], $config['appSecret']);
        }
    }


    public function handle()
    {
        $Message = $this->rc_handle->getMessage()->History();
        $params = [
            'date' => '2024112714', //日期
        ];
        var_dump($Message->get($params));

    }

}